# 抖码算法，让算法学习变得简单有趣
# 作者：老汤

n = int(input())
data = str(input()).split(" ")
nums = [0] * n
for i in range(n):
    nums[i] = int(data[i])

res, has_found = [0] * 3, False
for i in range(n):
    for j in range(n):
        if i == j:
            continue
        for k in range(n):
            if i == k or j == k:
                continue
            if nums[i] == nums[j] + 2 * nums[k]:
                res[0] = str(nums[i])
                res[1] = str(nums[j])
                res[2] = str(nums[k])
                has_found = True
                break
        if has_found:
            break
    if has_found:
        break

if has_found:
    print(" ".join(res))
else:
    print(0)